#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@FileName: Hodgkin-Huxley.py
@Version: 1.0
@Date: 2023/11/22 9:49
@Description:
"""
from typing import Tuple, List, Callable


def hh(inter: Tuple[float, float], ic: float, n: int) -> List[float]:
    pass


TriFloat = Tuple[float, float, float]
Dual2Float = Callable[[float, float], float]


def rk4step(twh: TriFloat, ydot: Dual2Float) -> float:
    # 龙格--库塔4阶方法的一步
    t, w, h = twh
    s1: float = ydot(t, w)
    s2: float = ydot(t + h / 2, w + h * s1 / 2)
    s3: float = ydot(t + h / 2, w + h * s2 / 2)
    s4: float = ydot(t + h, w + h * s3)
    y: float = w + h * (s1 + 2 * s2 + 2 * s3 + s4) / 6
    return y
